﻿angular.module("app").factory('djinnDef', function () {

  function thing(cost, buff, name) {
    this.cost = cost;
    this.buff = buff;
    this.name = name;
    this.num = 0;
    this.flag = false;
  }

  function baseDjinn(name,list) {
    this.name = name;
    this.pp = 0;
    this.display = 0;
    this.tickMulti = 1;
    this.clickMulti = 1;
    this.tick = 1;
    this.click = 1;
    this.Things = [
      new thing(Math.pow(2, 0) * 10, Math.pow(2, 0), "Basic"),
      new thing(Math.pow(2, 2) * 10, Math.pow(2, 1), "Simple"),
      new thing(Math.pow(2, 4) * 10, Math.pow(2, 2), "Intermediate"),
      new thing(Math.pow(2, 6) * 10, Math.pow(2, 3), "Advanced"),
      new thing(Math.pow(2, 8) * 10, Math.pow(2, 4), "Master"),
      new thing(Math.pow(2, 10) * 10, Math.pow(2, 5), "Ultimate"),
      new thing(Math.pow(2, 12) * 10, Math.pow(2, 6), "Divine"),
      new thing(Math.pow(2, 14) * 10, Math.pow(2, 7), "Golden")
    ];
    this.Hats = [null, null];
    list.push(this);
  };

  return{
    CreateDjinn: function(name, list) {
      return new baseDjinn(name, list);
    }
  }
});